import tornado.ioloop
from chess_msg import ChessMsg

class MainHandler(tornado.web.RequestHandler):
    def get(self,api_name):
        print(self.session._get_cookie_sid())
        self.write("Hello, world")

def make_app():
    print("启动web 端口:8889")
    return tornado.web.Application([
        (r"/ws/chess_msg", ChessMsg),
        (r"/api/(.*)", MainHandler),
    ],debug=True)

if __name__ == "__main__":
    app = make_app()
    app.listen(8889)
    tornado.ioloop.IOLoop.current().start()